package com.yvon.service.demo.algorithm.offer.ext;

public class ListNode<E> {

    public E value;

    public ListNode<E> next;

    public ListNode(E value) {
        this.value = value;
    }

    public ListNode(E value, ListNode<E> next) {
        this.value = value;
        this.next = next;
    }

    public static void printLinkedList(ListNode<Integer> head){
        while(head != null){
            System.out.print(head.value + " ");
            head = head.next;
        }
        System.out.println();
    }
}
